﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework5
{
    class Program2
    {
        static void Main(string[] args)
        {
            int i = 0;
            int sum = 0;
            double average = 0;
            List<int> list = new List<int>();
            Random random = new Random();
            while (i < 100)
            {
                i++;
                int num = random.Next(1001);
                list.Add(num);
            }
            var orderList = from item in list
                            orderby item descending
                            select item;
            foreach (var num in orderList)
            {
                sum += num;
            }
            average = (double)sum / 100;
            Console.WriteLine("NumUnion:{0}", sum);
            Console.WriteLine("Average:{0}" , average);
        }
    }
}
